package com.cloud.sample.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class UserMessageReceiver implements MessageListener {

    @Override
    @RabbitListener(queues = "AmsSyncUser.CloudConsumer")
    public void onMessage(Message message) {
        String result = new String(message.getBody());
        log.info("message >>> {}", result);
    }

}
